﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using QLKS.Templates;
using Infragistics.Windows.Editors;

namespace QLKS.Views
{
    /// <summary>
    /// Interaction logic for frmDKLocBCDoanhThuTheoLoaiPhong.xaml
    /// </summary>
    public partial class frmDKLocBCDoanhThuTheoLoaiPhong : FormTrans
    {
        public int nam;
        public int ky;
        public bool flag = false;
        public frmDKLocBCDoanhThuTheoLoaiPhong()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(txtNam.Text))
            {
                MessageBox.Show(M_LAN.Equals("V") ? "Chưa nhập năm" : "Input year, please!", "QLKS", MessageBoxButton.OK, MessageBoxImage.Error);
                txtNam.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtKy.Text))
            {
                MessageBox.Show(M_LAN.Equals("V") ? "Chưa nhập kỳ" : "Input Period, please!", "QLKS", MessageBoxButton.OK, MessageBoxImage.Error);
                txtNam.Focus();
                return;
            }
            nam = int.Parse(txtNam.Text);
            ky = int.Parse(txtKy.Text);
            flag = true;
            this.Close();
        }

        private void FormTrans_Loaded(object sender, RoutedEventArgs e)
        {
            txtNam.Text = DateTime.Now.Year.ToString();
            txtNam.Focus();
        }

        private void txtKy_GotFocus(object sender, RoutedEventArgs e)
        {
            (sender as XamMaskedEditor).SelectAll();
        }
    }
}
